package org.dromara.common.web.config

import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

class CorsConfig : WebMvcConfigurer {
    override fun addCorsMappings(registry: CorsRegistry) {
        registry.addMapping("/**")
            .exposedHeaders("Authorization", "token")
            .allowedOriginPatterns("*")
            .allowCredentials(true)
            .allowedMethods("*")
            .maxAge(3600)
        super.addCorsMappings(registry)
    }
}
